<div ng-controller="cubeCtrl">
	{if $_GPC['iseditor']}
	<!--魔方-->
	<div class="app-cube-edit">
		<div class="arrow-left"></div>
		<div class="inner">
		<div class="panel panel-default">
			<div class="panel-body form-horizontal">
				<div class="form-group">
					<label class="col-xs-3 control-label">布局</label>
					<div class="col-xs-9">
						<table id="cube-editor">
							<tr ng-repeat="(x, row) in activeItem.params.layout">
								<td ng-repeat="(y, col) in row" class="{{col.classname}} rows-{{col.rows}} cols-{{col.cols}}" ng-click="col['isempty'] ? showSelection(x, y) : changeItem(x, y)" ng-class="{'empty' : col.isempty, 'not-empty' : !col.isempty}" rowspan="{{col.rows}}" colspan="{{col.cols}}"  x="{{x}}" y="{{y}}">
									<div ng-if="col.isempty">+</div>
									<div ng-if="!col.imgurl && !col.isempty">{{col.cols * 160}} * {{col.rows * 160}}</div>
									<div ng-if="!col.isempty && col.imgurl"><img ng-src="{{col.imgurl}}" width="{{col.cols * 60}}" height="{{col.rows * 60}}" /></div>
								</td>
							</tr>
						</table>
						<span class="help-block">点击"+",添加内容</span><img ng-src="{{col.imgurl}}" width="{{col.cols * 60}}" height="{{col.cols * 60}}" />
					</div>
				</div>
				<div ng-show="activeItem.params.currentLayout.isempty == false" class="add-cube-item card clearfix">
					<div class="btns">
						<a href="#"><i class="fa fa-times"></i></a>
					</div>
					<div class="form-group">
						<label class="control-label col-xs-3"><span class="red">*</span>选择图片</label>
						<div class="col-xs-9 form-control-static">
							<div style="width:50px; height:50px; overflow:hidden; float:left; margin-right:10px;"><img ng-src="{{activeItem.params.currentLayout.imgurl}}" id="thumb" /></div>
							<span ng-click="addItem()"><i class="fa fa-plus-circle green"></i>&nbsp;添加图片</span>
							<span class="help-block">建议尺寸：{{activeItem.params.currentLayout.cols * 160}} * {{activeItem.params.currentLayout.rows * 160}} 像素</span>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-xs-3">链接</label>
						<div class="col-xs-9 form-control-static ">
							<div ng-my-linker ng-my-url="activeItem.params.currentLayout.url" ng-my-title="activeItem.params.currentLayout.title"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		</div>
	</div>
	<!--end魔方-->
	<div id="modal-cube-layout" class="modal fade in" role="dialog" aria-hidden="false">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h3>选择布局</h3>
				</div>
				<div class="modal-body text-center">
					<div class="layout-table">
						<ul class="layout-cols layout-rows-{{col.rows}} clearfix" ng-repeat="row in activeItem.params.selection">
							<li data-cols="{{col.cols}}" data-rows="{{col.rows}}" ng-click="selectLayout(activeItem.params.currentPos.row, activeItem.params.currentPos.col, col.rows, col.cols)" ng-repeat="col in row"></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	{else}
	<!--app魔方-->
	<div class="app-cube">
		<div class="inner">
			<table>
				<tr ng-repeat="row in module.params.layout" ng-init="rowindex=$index">
					<td ng-init="colindex=$index" ng-repeat="col in row" class="{{col.classname}} rows-{{col.rows}} cols-{{col.cols}}" ng-class="{'empty' : col.isempty, 'not-empty' : !col.isempty}" rowspan="{{col.rows}}" colspan="{{col.cols}}">
						<div ng-if="!col.isempty && col.imgurl"><a href="{{col.url}}"><img ng-src="{{col.imgurl}}" width="{{col.cols * 60}}" height="{{col.rows * 60}}" /></a></div>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!--end魔方-->
	{/if}
</div>